using UnityEngine;
using System.Collections;

public class Explicativa2 : MonoBehaviour
{
    GameObject g;
    private int Id = 4;

    void Start()
    {
        SceneManager.scene = "Explicativa2";

        this.gameObject.AddComponent("MeshRenderer");
        this.gameObject.AddComponent("MeshFilter");
        this.gameObject.AddComponent("BoxCollider");

        this.transform.position = new Vector3(0, 0, 0);
        Mesh mesh = Quad.Create(1.5f, 1);

        this.gameObject.GetComponent<MeshFilter>().mesh = mesh;
        this.gameObject.GetComponent<MeshRenderer>().material = AtlasManager.globalMaterial;
        this.gameObject.GetComponent<MeshFilter>().mesh.uv = new Vector2[]
		{
			new Vector2(AtlasManager.rects[Id].xMin, AtlasManager.rects[Id].yMax),
			new Vector2(AtlasManager.rects[Id].xMax, AtlasManager.rects[Id].yMax),
			new Vector2(AtlasManager.rects[Id].xMax, AtlasManager.rects[Id].yMin),
			new Vector2(AtlasManager.rects[Id].xMin, AtlasManager.rects[Id].yMin)
		};
    }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Return))
        {
            SceneManager.Change();
        }
    }
}
